/**
 * Created by conan on 15-9-17.
 */

var chkLogin = function(req,res,next){
    if(!req.session.user){
        //相对路径是：req.url
        //相对根目录 ：req.originalUrl
       res.redirect("/admin/login?returnurl="+req.originalUrl);

    }
    next();
}

module.exports = chkLogin;